<template>
  <div style="text-align: center;box-sizing=border-box">
    <h1>找回密码</h1>
    <div class="pass">
        <input type="text" placeholder="手机号码" v-model="phoneNumber">
        <input type="text" placeholder="短信验证码">
        <button @click="SendCode1">获取验证码</button>
        <input type="text" placeholder="设置新密码" v-model="newPassword">
        <input type="text" placeholder="确认新密码">

        <input type="button" value="找回密码" @click="UpdataP">

        
    </div>
    <div class="bottom">
            <span>已有律师侠账号，</span>
            <router-link to="/login">立即登录</router-link>
    </div>
  </div>
</template>

<script>

import {mapActions} from 'vuex'

export default {
  data() {
    return {
      phoneNumber:'',
      newPassword:''
    }
  },
  methods: {
    ...mapActions("yang", ["SENDCODE","RETRIEVE"]),
    SendCode1(){
      let formData = new FormData();
      formData.append("phoneNumber", this.phoneNumber);
      this.SENDCODE({ formData });
    },
    UpdataP(){
      let param={
        username:this.phoneNumber,
        newPassword:this.newPassword
      }
      this.RETRIEVE({param})
    }
  },
}
</script>

<style scoped lang="scss">
h1{
  padding-top: 2.5rem;
}
.pass{
    display: flex;
    flex-wrap: wrap;
    justify-content: space-evenly;
    align-content: space-around;
    position: relative;
    input{
    margin-top: .6rem;
    width: 4.5rem;
    height: .9rem;
    border: 2px solid #999999;
    border-radius: .5rem;
    text-indent: .5rem;
    &:nth-last-child(1){
        text-indent: 0;
    }
}
button{
        position: absolute;
        top: 2.4rem;
        right: 1.8rem;
    }
}
.bottom{
  position: absolute;
    bottom: 0.8rem;
    right: 2rem;
}



</style>